<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数传参</title>
    
</head>
<body>
    <script type="text/javascript">
        // 形式参数
        function func1(i) {
            htmlStr = '<h1>' + '做饭' + i + '次' + '</h1>';
            document.write(htmlStr);
        }
        var i;
        for(i=1;i<=10;i++){
            func1(i);
        }
    </script>
</body>
</html>